<?php
	/**
	 * This is a MetaControl class, providing a QForm or QPanel access to event handlers
	 * and QControls to perform the Create, Edit, and Delete functionality
	 * of the TableProjectAgreement class.  This code-generated class
	 * contains all the basic elements to help a QPanel or QForm display an HTML form that can
	 * manipulate a single TableProjectAgreement object.
	 *
	 * To take advantage of some (or all) of these control objects, you
	 * must create a new QForm or QPanel which instantiates a TableProjectAgreementMetaControl
	 * class.
	 *
	 * Any and all changes to this file will be overwritten with any subsequent
	 * code re-generation.
	 * 
	 * @package My Application
	 * @subpackage MetaControls
	 * property-read TableProjectAgreement $TableProjectAgreement the actual TableProjectAgreement data class being edited
	 * property QLabel $IdControl
	 * property-read QLabel $IdLabel
	 * property QListBox $ProjectIdControl
	 * property-read QLabel $ProjectIdLabel
	 * property QIntegerTextBox $BuyerIdControl
	 * property-read QLabel $BuyerIdLabel
	 * property QIntegerTextBox $ProviderIdControl
	 * property-read QLabel $ProviderIdLabel
	 * property QDateTimePicker $BuyerAgreeDateControl
	 * property-read QLabel $BuyerAgreeDateLabel
	 * property QDateTimePicker $ProviderAgreeDateControl
	 * property-read QLabel $ProviderAgreeDateLabel
	 * property QTextBox $AgreementControl
	 * property-read QLabel $AgreementLabel
	 * property QTextBox $BuyerAgreeControl
	 * property-read QLabel $BuyerAgreeLabel
	 * property QTextBox $ProviderAgreeControl
	 * property-read QLabel $ProviderAgreeLabel
	 * property QTextBox $ActiveControl
	 * property-read QLabel $ActiveLabel
	 * property-read string $TitleVerb a verb indicating whether or not this is being edited or created
	 * property-read boolean $EditMode a boolean indicating whether or not this is being edited or created
	 */

	class TableProjectAgreementMetaControlGen extends QBaseClass {
		// General Variables
		protected $objTableProjectAgreement;
		protected $objParentObject;
		protected $strTitleVerb;
		protected $blnEditMode;

		// Controls that allow the editing of TableProjectAgreement's individual data fields
		protected $lblId;
		protected $lstProject;
		protected $txtBuyerId;
		protected $txtProviderId;
		protected $calBuyerAgreeDate;
		protected $calProviderAgreeDate;
		protected $txtAgreement;
		protected $txtBuyerAgree;
		protected $txtProviderAgree;
		protected $txtActive;

		// Controls that allow the viewing of TableProjectAgreement's individual data fields
		protected $lblProjectId;
		protected $lblBuyerId;
		protected $lblProviderId;
		protected $lblBuyerAgreeDate;
		protected $lblProviderAgreeDate;
		protected $lblAgreement;
		protected $lblBuyerAgree;
		protected $lblProviderAgree;
		protected $lblActive;

		// QListBox Controls (if applicable) to edit Unique ReverseReferences and ManyToMany References

		// QLabel Controls (if applicable) to view Unique ReverseReferences and ManyToMany References


		/**
		 * Main constructor.  Constructor OR static create methods are designed to be called in either
		 * a parent QPanel or the main QForm when wanting to create a
		 * TableProjectAgreementMetaControl to edit a single TableProjectAgreement object within the
		 * QPanel or QForm.
		 *
		 * This constructor takes in a single TableProjectAgreement object, while any of the static
		 * create methods below can be used to construct based off of individual PK ID(s).
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableProjectAgreementMetaControl
		 * @param TableProjectAgreement $objTableProjectAgreement new or existing TableProjectAgreement object
		 */
		 public function __construct($objParentObject, TableProjectAgreement $objTableProjectAgreement) {
			// Setup Parent Object (e.g. QForm or QPanel which will be using this TableProjectAgreementMetaControl)
			$this->objParentObject = $objParentObject;

			// Setup linked TableProjectAgreement object
			$this->objTableProjectAgreement = $objTableProjectAgreement;

			// Figure out if we're Editing or Creating New
			if ($this->objTableProjectAgreement->__Restored) {
				$this->strTitleVerb = QApplication::Translate('Edit');
				$this->blnEditMode = true;
			} else {
				$this->strTitleVerb = QApplication::Translate('Create');
				$this->blnEditMode = false;
			}
		 }

		/**
		 * Static Helper Method to Create using PK arguments
		 * You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
		 * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
		 * static helper methods.  Finally, specify a CreateType to define whether or not we are only allowed to 
		 * edit, or if we are also allowed to create a new one, etc.
		 * 
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableProjectAgreementMetaControl
		 * @param integer $intId primary key value
		 * @param QMetaControlCreateType $intCreateType rules governing TableProjectAgreement object creation - defaults to CreateOrEdit
 		 * @return TableProjectAgreementMetaControl
		 */
		public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			// Attempt to Load from PK Arguments
			if (strlen($intId)) {
				$objTableProjectAgreement = TableProjectAgreement::Load($intId);

				// TableProjectAgreement was found -- return it!
				if ($objTableProjectAgreement)
					return new TableProjectAgreementMetaControl($objParentObject, $objTableProjectAgreement);

				// If CreateOnRecordNotFound not specified, throw an exception
				else if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound)
					throw new QCallerException('Could not find a TableProjectAgreement object with PK arguments: ' . $intId);

			// If EditOnly is specified, throw an exception
			} else if ($intCreateType == QMetaControlCreateType::EditOnly)
				throw new QCallerException('No PK arguments specified');

			// If we are here, then we need to create a new record
			return new TableProjectAgreementMetaControl($objParentObject, new TableProjectAgreement());
		}

		/**
		 * Static Helper Method to Create using PathInfo arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableProjectAgreementMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing TableProjectAgreement object creation - defaults to CreateOrEdit
		 * @return TableProjectAgreementMetaControl
		 */
		public static function CreateFromPathInfo($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::PathInfo(0);
			return TableProjectAgreementMetaControl::Create($objParentObject, $intId, $intCreateType);
		}

		/**
		 * Static Helper Method to Create using QueryString arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableProjectAgreementMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing TableProjectAgreement object creation - defaults to CreateOrEdit
		 * @return TableProjectAgreementMetaControl
		 */
		public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::QueryString('intId');
			return TableProjectAgreementMetaControl::Create($objParentObject, $intId, $intCreateType);
		}



		///////////////////////////////////////////////
		// PUBLIC CREATE and REFRESH METHODS
		///////////////////////////////////////////////

		/**
		 * Create and setup QLabel lblId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblId_Create($strControlId = null) {
			$this->lblId = new QLabel($this->objParentObject, $strControlId);
			$this->lblId->Name = QApplication::Translate('Id');
			if ($this->blnEditMode)
				$this->lblId->Text = $this->objTableProjectAgreement->Id;
			else
				$this->lblId->Text = 'N/A';
			return $this->lblId;
		}

		/**
		 * Create and setup QListBox lstProject
		 * @param string $strControlId optional ControlId to use
		 * @return QListBox
		 */
		public function lstProject_Create($strControlId = null) {
			$this->lstProject = new QListBox($this->objParentObject, $strControlId);
			$this->lstProject->Name = QApplication::Translate('Project');
			$this->lstProject->Required = true;
			if (!$this->blnEditMode)
				$this->lstProject->AddItem(QApplication::Translate('- Select One -'), null);
			$objProjectArray = TableProject::LoadAll();
			if ($objProjectArray) foreach ($objProjectArray as $objProject) {
				$objListItem = new QListItem($objProject->__toString(), $objProject->Id);
				if (($this->objTableProjectAgreement->Project) && ($this->objTableProjectAgreement->Project->Id == $objProject->Id))
					$objListItem->Selected = true;
				$this->lstProject->AddItem($objListItem);
			}
			return $this->lstProject;
		}

		/**
		 * Create and setup QLabel lblProjectId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblProjectId_Create($strControlId = null) {
			$this->lblProjectId = new QLabel($this->objParentObject, $strControlId);
			$this->lblProjectId->Name = QApplication::Translate('Project');
			$this->lblProjectId->Text = ($this->objTableProjectAgreement->Project) ? $this->objTableProjectAgreement->Project->__toString() : null;
			$this->lblProjectId->Required = true;
			return $this->lblProjectId;
		}

		/**
		 * Create and setup QIntegerTextBox txtBuyerId
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtBuyerId_Create($strControlId = null) {
			$this->txtBuyerId = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtBuyerId->Name = QApplication::Translate('Buyer Id');
			$this->txtBuyerId->Text = $this->objTableProjectAgreement->BuyerId;
			$this->txtBuyerId->Required = true;
			return $this->txtBuyerId;
		}

		/**
		 * Create and setup QLabel lblBuyerId
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblBuyerId_Create($strControlId = null, $strFormat = null) {
			$this->lblBuyerId = new QLabel($this->objParentObject, $strControlId);
			$this->lblBuyerId->Name = QApplication::Translate('Buyer Id');
			$this->lblBuyerId->Text = $this->objTableProjectAgreement->BuyerId;
			$this->lblBuyerId->Required = true;
			$this->lblBuyerId->Format = $strFormat;
			return $this->lblBuyerId;
		}

		/**
		 * Create and setup QIntegerTextBox txtProviderId
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtProviderId_Create($strControlId = null) {
			$this->txtProviderId = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtProviderId->Name = QApplication::Translate('Provider Id');
			$this->txtProviderId->Text = $this->objTableProjectAgreement->ProviderId;
			$this->txtProviderId->Required = true;
			return $this->txtProviderId;
		}

		/**
		 * Create and setup QLabel lblProviderId
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblProviderId_Create($strControlId = null, $strFormat = null) {
			$this->lblProviderId = new QLabel($this->objParentObject, $strControlId);
			$this->lblProviderId->Name = QApplication::Translate('Provider Id');
			$this->lblProviderId->Text = $this->objTableProjectAgreement->ProviderId;
			$this->lblProviderId->Required = true;
			$this->lblProviderId->Format = $strFormat;
			return $this->lblProviderId;
		}

		/**
		 * Create and setup QDateTimePicker calBuyerAgreeDate
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calBuyerAgreeDate_Create($strControlId = null) {
			$this->calBuyerAgreeDate = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calBuyerAgreeDate->Name = QApplication::Translate('Buyer Agree Date');
			$this->calBuyerAgreeDate->DateTime = $this->objTableProjectAgreement->BuyerAgreeDate;
			$this->calBuyerAgreeDate->DateTimePickerType = QDateTimePickerType::DateTime;
			return $this->calBuyerAgreeDate;
		}

		/**
		 * Create and setup QLabel lblBuyerAgreeDate
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblBuyerAgreeDate_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblBuyerAgreeDate = new QLabel($this->objParentObject, $strControlId);
			$this->lblBuyerAgreeDate->Name = QApplication::Translate('Buyer Agree Date');
			$this->strBuyerAgreeDateDateTimeFormat = $strDateTimeFormat;
			$this->lblBuyerAgreeDate->Text = sprintf($this->objTableProjectAgreement->BuyerAgreeDate) ? $this->objTableProjectAgreement->BuyerAgreeDate->__toString($this->strBuyerAgreeDateDateTimeFormat) : null;
			return $this->lblBuyerAgreeDate;
		}

		protected $strBuyerAgreeDateDateTimeFormat;


		/**
		 * Create and setup QDateTimePicker calProviderAgreeDate
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calProviderAgreeDate_Create($strControlId = null) {
			$this->calProviderAgreeDate = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calProviderAgreeDate->Name = QApplication::Translate('Provider Agree Date');
			$this->calProviderAgreeDate->DateTime = $this->objTableProjectAgreement->ProviderAgreeDate;
			$this->calProviderAgreeDate->DateTimePickerType = QDateTimePickerType::DateTime;
			return $this->calProviderAgreeDate;
		}

		/**
		 * Create and setup QLabel lblProviderAgreeDate
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblProviderAgreeDate_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblProviderAgreeDate = new QLabel($this->objParentObject, $strControlId);
			$this->lblProviderAgreeDate->Name = QApplication::Translate('Provider Agree Date');
			$this->strProviderAgreeDateDateTimeFormat = $strDateTimeFormat;
			$this->lblProviderAgreeDate->Text = sprintf($this->objTableProjectAgreement->ProviderAgreeDate) ? $this->objTableProjectAgreement->ProviderAgreeDate->__toString($this->strProviderAgreeDateDateTimeFormat) : null;
			return $this->lblProviderAgreeDate;
		}

		protected $strProviderAgreeDateDateTimeFormat;


		/**
		 * Create and setup QTextBox txtAgreement
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtAgreement_Create($strControlId = null) {
			$this->txtAgreement = new QTextBox($this->objParentObject, $strControlId);
			$this->txtAgreement->Name = QApplication::Translate('Agreement');
			$this->txtAgreement->Text = $this->objTableProjectAgreement->Agreement;
			$this->txtAgreement->TextMode = QTextMode::MultiLine;
			return $this->txtAgreement;
		}

		/**
		 * Create and setup QLabel lblAgreement
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblAgreement_Create($strControlId = null) {
			$this->lblAgreement = new QLabel($this->objParentObject, $strControlId);
			$this->lblAgreement->Name = QApplication::Translate('Agreement');
			$this->lblAgreement->Text = $this->objTableProjectAgreement->Agreement;
			return $this->lblAgreement;
		}

		/**
		 * Create and setup QTextBox txtBuyerAgree
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtBuyerAgree_Create($strControlId = null) {
			$this->txtBuyerAgree = new QTextBox($this->objParentObject, $strControlId);
			$this->txtBuyerAgree->Name = QApplication::Translate('Buyer Agree');
			$this->txtBuyerAgree->Text = $this->objTableProjectAgreement->BuyerAgree;
			$this->txtBuyerAgree->MaxLength = TableProjectAgreement::BuyerAgreeMaxLength;
			return $this->txtBuyerAgree;
		}

		/**
		 * Create and setup QLabel lblBuyerAgree
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblBuyerAgree_Create($strControlId = null) {
			$this->lblBuyerAgree = new QLabel($this->objParentObject, $strControlId);
			$this->lblBuyerAgree->Name = QApplication::Translate('Buyer Agree');
			$this->lblBuyerAgree->Text = $this->objTableProjectAgreement->BuyerAgree;
			return $this->lblBuyerAgree;
		}

		/**
		 * Create and setup QTextBox txtProviderAgree
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtProviderAgree_Create($strControlId = null) {
			$this->txtProviderAgree = new QTextBox($this->objParentObject, $strControlId);
			$this->txtProviderAgree->Name = QApplication::Translate('Provider Agree');
			$this->txtProviderAgree->Text = $this->objTableProjectAgreement->ProviderAgree;
			$this->txtProviderAgree->MaxLength = TableProjectAgreement::ProviderAgreeMaxLength;
			return $this->txtProviderAgree;
		}

		/**
		 * Create and setup QLabel lblProviderAgree
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblProviderAgree_Create($strControlId = null) {
			$this->lblProviderAgree = new QLabel($this->objParentObject, $strControlId);
			$this->lblProviderAgree->Name = QApplication::Translate('Provider Agree');
			$this->lblProviderAgree->Text = $this->objTableProjectAgreement->ProviderAgree;
			return $this->lblProviderAgree;
		}

		/**
		 * Create and setup QTextBox txtActive
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtActive_Create($strControlId = null) {
			$this->txtActive = new QTextBox($this->objParentObject, $strControlId);
			$this->txtActive->Name = QApplication::Translate('Active');
			$this->txtActive->Text = $this->objTableProjectAgreement->Active;
			$this->txtActive->Required = true;
			$this->txtActive->MaxLength = TableProjectAgreement::ActiveMaxLength;
			return $this->txtActive;
		}

		/**
		 * Create and setup QLabel lblActive
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblActive_Create($strControlId = null) {
			$this->lblActive = new QLabel($this->objParentObject, $strControlId);
			$this->lblActive->Name = QApplication::Translate('Active');
			$this->lblActive->Text = $this->objTableProjectAgreement->Active;
			$this->lblActive->Required = true;
			return $this->lblActive;
		}



		/**
		 * Refresh this MetaControl with Data from the local TableProjectAgreement object.
		 * @param boolean $blnReload reload TableProjectAgreement from the database
		 * @return void
		 */
		public function Refresh($blnReload = false) {
			if ($blnReload)
				$this->objTableProjectAgreement->Reload();

			if ($this->lblId) if ($this->blnEditMode) $this->lblId->Text = $this->objTableProjectAgreement->Id;

			if ($this->lstProject) {
					$this->lstProject->RemoveAllItems();
				if (!$this->blnEditMode)
					$this->lstProject->AddItem(QApplication::Translate('- Select One -'), null);
				$objProjectArray = TableProject::LoadAll();
				if ($objProjectArray) foreach ($objProjectArray as $objProject) {
					$objListItem = new QListItem($objProject->__toString(), $objProject->Id);
					if (($this->objTableProjectAgreement->Project) && ($this->objTableProjectAgreement->Project->Id == $objProject->Id))
						$objListItem->Selected = true;
					$this->lstProject->AddItem($objListItem);
				}
			}
			if ($this->lblProjectId) $this->lblProjectId->Text = ($this->objTableProjectAgreement->Project) ? $this->objTableProjectAgreement->Project->__toString() : null;

			if ($this->txtBuyerId) $this->txtBuyerId->Text = $this->objTableProjectAgreement->BuyerId;
			if ($this->lblBuyerId) $this->lblBuyerId->Text = $this->objTableProjectAgreement->BuyerId;

			if ($this->txtProviderId) $this->txtProviderId->Text = $this->objTableProjectAgreement->ProviderId;
			if ($this->lblProviderId) $this->lblProviderId->Text = $this->objTableProjectAgreement->ProviderId;

			if ($this->calBuyerAgreeDate) $this->calBuyerAgreeDate->DateTime = $this->objTableProjectAgreement->BuyerAgreeDate;
			if ($this->lblBuyerAgreeDate) $this->lblBuyerAgreeDate->Text = sprintf($this->objTableProjectAgreement->BuyerAgreeDate) ? $this->objTableProjectAgreement->BuyerAgreeDate->__toString($this->strBuyerAgreeDateDateTimeFormat) : null;

			if ($this->calProviderAgreeDate) $this->calProviderAgreeDate->DateTime = $this->objTableProjectAgreement->ProviderAgreeDate;
			if ($this->lblProviderAgreeDate) $this->lblProviderAgreeDate->Text = sprintf($this->objTableProjectAgreement->ProviderAgreeDate) ? $this->objTableProjectAgreement->ProviderAgreeDate->__toString($this->strProviderAgreeDateDateTimeFormat) : null;

			if ($this->txtAgreement) $this->txtAgreement->Text = $this->objTableProjectAgreement->Agreement;
			if ($this->lblAgreement) $this->lblAgreement->Text = $this->objTableProjectAgreement->Agreement;

			if ($this->txtBuyerAgree) $this->txtBuyerAgree->Text = $this->objTableProjectAgreement->BuyerAgree;
			if ($this->lblBuyerAgree) $this->lblBuyerAgree->Text = $this->objTableProjectAgreement->BuyerAgree;

			if ($this->txtProviderAgree) $this->txtProviderAgree->Text = $this->objTableProjectAgreement->ProviderAgree;
			if ($this->lblProviderAgree) $this->lblProviderAgree->Text = $this->objTableProjectAgreement->ProviderAgree;

			if ($this->txtActive) $this->txtActive->Text = $this->objTableProjectAgreement->Active;
			if ($this->lblActive) $this->lblActive->Text = $this->objTableProjectAgreement->Active;

		}



		///////////////////////////////////////////////
		// PROTECTED UPDATE METHODS for ManyToManyReferences (if any)
		///////////////////////////////////////////////





		///////////////////////////////////////////////
		// PUBLIC TABLEPROJECTAGREEMENT OBJECT MANIPULATORS
		///////////////////////////////////////////////

		/**
		 * This will save this object's TableProjectAgreement instance,
		 * updating only the fields which have had a control created for it.
		 */
		public function SaveTableProjectAgreement() {
			try {
				// Update any fields for controls that have been created
				if ($this->lstProject) $this->objTableProjectAgreement->ProjectId = $this->lstProject->SelectedValue;
				if ($this->txtBuyerId) $this->objTableProjectAgreement->BuyerId = $this->txtBuyerId->Text;
				if ($this->txtProviderId) $this->objTableProjectAgreement->ProviderId = $this->txtProviderId->Text;
				if ($this->calBuyerAgreeDate) $this->objTableProjectAgreement->BuyerAgreeDate = $this->calBuyerAgreeDate->DateTime;
				if ($this->calProviderAgreeDate) $this->objTableProjectAgreement->ProviderAgreeDate = $this->calProviderAgreeDate->DateTime;
				if ($this->txtAgreement) $this->objTableProjectAgreement->Agreement = $this->txtAgreement->Text;
				if ($this->txtBuyerAgree) $this->objTableProjectAgreement->BuyerAgree = $this->txtBuyerAgree->Text;
				if ($this->txtProviderAgree) $this->objTableProjectAgreement->ProviderAgree = $this->txtProviderAgree->Text;
				if ($this->txtActive) $this->objTableProjectAgreement->Active = $this->txtActive->Text;

				// Update any UniqueReverseReferences (if any) for controls that have been created for it

				// Save the TableProjectAgreement object
				$this->objTableProjectAgreement->Save();

				// Finally, update any ManyToManyReferences (if any)
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * This will DELETE this object's TableProjectAgreement instance from the database.
		 * It will also unassociate itself from any ManyToManyReferences.
		 */
		public function DeleteTableProjectAgreement() {
			$this->objTableProjectAgreement->Delete();
		}		



		///////////////////////////////////////////////
		// PUBLIC GETTERS and SETTERS
		///////////////////////////////////////////////

		/**
		 * Override method to perform a property "Get"
		 * This will get the value of $strName
		 *
		 * @param string $strName Name of the property to get
		 * @return mixed
		 */
		public function __get($strName) {
			switch ($strName) {
				// General MetaControlVariables
				case 'TableProjectAgreement': return $this->objTableProjectAgreement;
				case 'TitleVerb': return $this->strTitleVerb;
				case 'EditMode': return $this->blnEditMode;

				// Controls that point to TableProjectAgreement fields -- will be created dynamically if not yet created
				case 'IdControl':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'IdLabel':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'ProjectIdControl':
					if (!$this->lstProject) return $this->lstProject_Create();
					return $this->lstProject;
				case 'ProjectIdLabel':
					if (!$this->lblProjectId) return $this->lblProjectId_Create();
					return $this->lblProjectId;
				case 'BuyerIdControl':
					if (!$this->txtBuyerId) return $this->txtBuyerId_Create();
					return $this->txtBuyerId;
				case 'BuyerIdLabel':
					if (!$this->lblBuyerId) return $this->lblBuyerId_Create();
					return $this->lblBuyerId;
				case 'ProviderIdControl':
					if (!$this->txtProviderId) return $this->txtProviderId_Create();
					return $this->txtProviderId;
				case 'ProviderIdLabel':
					if (!$this->lblProviderId) return $this->lblProviderId_Create();
					return $this->lblProviderId;
				case 'BuyerAgreeDateControl':
					if (!$this->calBuyerAgreeDate) return $this->calBuyerAgreeDate_Create();
					return $this->calBuyerAgreeDate;
				case 'BuyerAgreeDateLabel':
					if (!$this->lblBuyerAgreeDate) return $this->lblBuyerAgreeDate_Create();
					return $this->lblBuyerAgreeDate;
				case 'ProviderAgreeDateControl':
					if (!$this->calProviderAgreeDate) return $this->calProviderAgreeDate_Create();
					return $this->calProviderAgreeDate;
				case 'ProviderAgreeDateLabel':
					if (!$this->lblProviderAgreeDate) return $this->lblProviderAgreeDate_Create();
					return $this->lblProviderAgreeDate;
				case 'AgreementControl':
					if (!$this->txtAgreement) return $this->txtAgreement_Create();
					return $this->txtAgreement;
				case 'AgreementLabel':
					if (!$this->lblAgreement) return $this->lblAgreement_Create();
					return $this->lblAgreement;
				case 'BuyerAgreeControl':
					if (!$this->txtBuyerAgree) return $this->txtBuyerAgree_Create();
					return $this->txtBuyerAgree;
				case 'BuyerAgreeLabel':
					if (!$this->lblBuyerAgree) return $this->lblBuyerAgree_Create();
					return $this->lblBuyerAgree;
				case 'ProviderAgreeControl':
					if (!$this->txtProviderAgree) return $this->txtProviderAgree_Create();
					return $this->txtProviderAgree;
				case 'ProviderAgreeLabel':
					if (!$this->lblProviderAgree) return $this->lblProviderAgree_Create();
					return $this->lblProviderAgree;
				case 'ActiveControl':
					if (!$this->txtActive) return $this->txtActive_Create();
					return $this->txtActive;
				case 'ActiveLabel':
					if (!$this->lblActive) return $this->lblActive_Create();
					return $this->lblActive;
				default:
					try {
						return parent::__get($strName);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}

		/**
		 * Override method to perform a property "Set"
		 * This will set the property $strName to be $mixValue
		 *
		 * @param string $strName Name of the property to set
		 * @param string $mixValue New value of the property
		 * @return mixed
		 */
		public function __set($strName, $mixValue) {
			try {
				switch ($strName) {
					// Controls that point to TableProjectAgreement fields
					case 'IdControl':
						return ($this->lblId = QType::Cast($mixValue, 'QControl'));
					case 'ProjectIdControl':
						return ($this->lstProject = QType::Cast($mixValue, 'QControl'));
					case 'BuyerIdControl':
						return ($this->txtBuyerId = QType::Cast($mixValue, 'QControl'));
					case 'ProviderIdControl':
						return ($this->txtProviderId = QType::Cast($mixValue, 'QControl'));
					case 'BuyerAgreeDateControl':
						return ($this->calBuyerAgreeDate = QType::Cast($mixValue, 'QControl'));
					case 'ProviderAgreeDateControl':
						return ($this->calProviderAgreeDate = QType::Cast($mixValue, 'QControl'));
					case 'AgreementControl':
						return ($this->txtAgreement = QType::Cast($mixValue, 'QControl'));
					case 'BuyerAgreeControl':
						return ($this->txtBuyerAgree = QType::Cast($mixValue, 'QControl'));
					case 'ProviderAgreeControl':
						return ($this->txtProviderAgree = QType::Cast($mixValue, 'QControl'));
					case 'ActiveControl':
						return ($this->txtActive = QType::Cast($mixValue, 'QControl'));
					default:
						return parent::__set($strName, $mixValue);
				}
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}
	}
?>